home *** CD-ROM | disk | FTP | other *** search
- /*
- File: XLetter.h
-
- Contains: xxx put contents here xxx
-
- Written by: Tim Harnett
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <7> 1/27/95 TMH added IsValidRecipeint
- <6> 1/13/95 TMH seperated OutgoingXLetter to seperate file
- <5> 1/11/95 TMH tweak to generalize framework
- <4> 10/13/94 TMH added AbortSend()
- <3> 10/3/94 TMH break of TWireless&TEWorld from TExternalSlot
- <2> 9/30/94 TMH parse incoming InfoWave letter properly
- <1> 9/20/94 TMH Abandon RoadsideRest embrace Mercury
- <2> 9/20/94 TMH some mods when writing a letter, use InfoWave letter format,
- experimental
- 9/1/94 TMH xxx put comment here xxx
-
- To Do:
- */
-
- #ifndef __XLetter__
- #define __XLetter__
-
- class TExternalSlot;
- class TIncomingALetter;
- class TOutgoingALetter;
-
- #ifndef __FileUtils__
- #include "FileUtils.h"
- #endif
-
- #ifndef __Letter__
- #include "Letter.h"
- #endif
-
- #ifndef __OutgoingLetterStream__
- #include "OutgoingLetterStream.h"
- #endif
-
- //---------------------------------
- // U t i l i t i e s
- //---------------------------------
- extern void MapOtherRecipient(CUnpackedDSSpec& unpackedRecipient,StringPtr otherRecipient);
- extern Boolean IsValidRecipient(CUnpackedDSSpec& unpackedRecipient);
-
- //--------------------------------------
- // T X L e t t e r
- //--------------------------------------
-
- class TXLetter : public TLetter {
- public:
- TXLetter();
- void IXLetter(TExternalSlot* xSlot);
- protected:
-
- TExternalSlot* fXSlot;
-
- };
-
-
- //--------------------------------------
- // T I n c o m i n g X L e t t e r
- //--------------------------------------
-
- // An incomming external letter.
-
- class TIncomingXLetter : public TXLetter {
- public:
- TIncomingXLetter();
- ~TIncomingXLetter();
- void IIncomingXLetter(TExternalSlot* xSlot,CFile& incomingLetterFile);
-
- void ParseAndValidateLetter();
-
- void DeliveryDone();
-
- void SetToStartOfBody() { fIncomingLetterFile.SetPosition(fBodyOffset); }
- long ReadBody(char* readBuf,long readBufSize);
-
-
- void SetToStartOfToRecipients() { fIncomingLetterFile.SetPosition(fToRecipientsOffset); }
- StringPtr ReadToRecipient(StringPtr toRecipient);
-
- private:
-
-
- CFile fIncomingLetterFile; // the file that contains the incoming letter from the external system
-
- long fToRecipientsOffset; // offset where the To: addresses start
- long fBodyOffset; // offset where the body of the letter starts.
- long fSenderNameOffset; // offset where the body of the letter starts.
- long fSubjectOffset; // offset where the body of the letter starts.
- };
-
- #endif __XLetter__